package ebj.common.annotation.demo_data_provider_manager;

import java.util.Map;

import ebj.common.annotation.demo_data_provider_manager.data_provider.DataProvider;
import ebj.common.annotation.demo_data_provider_manager.helper.WebViewHelper;
import ebj.common.annotation.demo_data_provider_manager.manager.DataProviderManager;
import ebj.common.annotation.demo_data_provider_manager.mocker.AppRuntimeDataMocker;

public class AppClient {
    public static void main(String[] args) throws Exception {
        DataProvider dataProvider = DataProviderManager.getDataProvider("jdbc");
        System.out.println(WebViewHelper.getQueryView(dataProvider));
        System.out.println(WebViewHelper.getDatasourceView(dataProvider));
        // mock 数据
//        Map<String, String> datasourceConfig = AppRuntimeDataMocker.getDemoDatasourceConfig();
//        Map<String, String> query = AppRuntimeDataMocker.getDemoQuery();
        Map<String, String> datasourceConfig = AppRuntimeDataMocker.getDatasourceConfig();
        Map<String, String> query = AppRuntimeDataMocker.getQuery();
        // 获取数据集data_set
        String[][] data = dataProvider.getData(datasourceConfig, query);
//        System.out.println(JSONObject.toJSONString(data));
    }
}
